package com.ryan.controller;

import com.ryan.entity.Products;
import com.ryan.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author raofy
 * @date 2021-09-23 13:33
 * @desc
 */
@RestController
@RequestMapping("product")
public class ProducerController {

    @Autowired
    private ProductService productService;

    @GetMapping("query/{id}")
    public Products query(@PathVariable Integer id) {
        return productService.findById(id);
    }
}
